﻿<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroBairro.aspx.cs" Inherits="JA.Web.Apresentacao.CadastroBairro" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">
    <div class="art-Block">
        <div class="art-Block-body">
            <div class="art-BlockHeader">
                <div class="l"></div>
                <div class="r"></div>
                <div class="art-header-tag-icon">
                    <div class="t">Cadastro de Bairros</div>
                </div>
            </div>
            <div class="art-BlockContent">
                <div class="art-BlockContent-tl"></div>
                <div class="art-BlockContent-tr"></div>
                <div class="art-BlockContent-bl"></div>
                <div class="art-BlockContent-br"></div>
                <div class="art-BlockContent-tc"></div>
                <div class="art-BlockContent-bc"></div>
                <div class="art-BlockContent-cl"></div>
                <div class="art-BlockContent-cr"></div>
                <div class="art-BlockContent-cc"></div>
                <div class="art-BlockContent-body">

    
    <asp:UpdatePanel ID="upnFamilia" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabBairro" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 98%;">
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        C&oacute;digo
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtId" runat="server"></asp:TextBox>
                                        <asp:MaskedEditExtender ID="mskTxtId" runat="server" Mask="9999999" TargetControlID="txtId" PromptCharacter="" />
                                    </td>
                                    <td>
                                        Bairro
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtBairro" runat="server"></asp:TextBox>
                                    </td>
                                 </tr>
                                <tr>
                                    <td>
                                        Estado
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlEstado" runat="server" DataTextField="uf" DataValueField="siglaUf"></asp:DropDownList>
                                    </td>
                                    <td>
                                        Cidade
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCidade" runat="server" DataTextField="cidade" DataValueField="idCidade"></asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Button ID="btnPesquisa" runat="server" Text="Pesquisa" OnClick="btnPesquisa_Click" />
                                        <br />
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!"
                                         OnRowDataBound="grvResultado_RowDataBound">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                            ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" CommandArgument='<%#Eval("IdBairro") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="IdBairro" HeaderText="ID" />
                                                <asp:BoundField DataField="Bairro" HeaderText="Bairro" />
                                                <asp:BoundField DataField="Cidade" HeaderText="Cidade" />
                                                <asp:TemplateField>
                                                    <HeaderTemplate>
                                                        Estado
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblEstado" runat="server" Text=''></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server">
                            <div style="width: 98%;">
                                <table style="width: 100%;">
                                    <tr>
                                        <td>
                                            C&oacute;digo:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadId" runat="server" Enabled="False"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Estado:
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCadEstado" runat="server" DataTextField="uf" DataValueField="siglaUf"
                                                              OnSelectedIndexChanged="ddlCadEstado_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Cidade:
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCadCidade" runat="server" DataTextField="cidade" DataValueField="idCidade"></asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Bairro:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadBairro" runat="server" Width="600px" MaxLength="45"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCadBairro"
                                                ErrorMessage="*" ValidationGroup="Salvar" />
                                        </td>
                                    </tr>

                                    <tr>
                                        <td style="vertical-align:top;">
                                            Data Cadastro:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Cadastrado por:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Data Edi&ccedil;&atilde;o:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Editado por:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <span style="color:Red;"> (*) Campos Obrigatórios </span><br />
                                            <br />
                                            <br />
                                            <asp:Button ID="btnSalvar" runat="server" Enabled="False" 
                                                OnClick="btnSalvar_Click" Text="Salvar"  ValidationGroup="Salvar" UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                                                Text="Cancelar"  UseSubmitBehavior="false"/>
                                             <asp:Button ID="btnEditar" runat="server" Enabled="False" 
                                                OnClick="btnEditar_Click" Text="Editar"  UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnExcluir" runat="server" Enabled="False" 
                                                OnClick="btnExcluir_Click" Text="Excluir"  UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnNovo" runat="server" OnClick="btnNovo_Click" Text="Novo"  UseSubmitBehavior="false"/>
                                            <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnExcluir" ConfirmText="Confirma a exclus&atilde;o do bairro?">
                                            </asp:ConfirmButtonExtender>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>


                </div>
            </div>
        </div>
    </div>


</asp:Content>




